package com.turboconnard.android.dialogs;

import android.app.AlertDialog.Builder;

import com.turboconnard.data.Library;
import com.turboconnard.events.Event;
import com.turboconnard.events.EventDispatcher;
import com.turboconnard.events.EventListener;

public class AlertDialog extends EventDispatcher implements EventListener{
	private Builder builder;
	private AlertDialogButton dyes;
	public AlertDialog(){
		
		builder = new android.app.AlertDialog.Builder(Library.getInstance().context);
		builder.setMessage("Are you sure you want to exit?");
		builder.setCancelable(true);
		/*
		builder.setNegativeButton("No", new DialogInterface.OnClickListener() {
		           public void onClick(DialogInterface dialog, int id) {
		                dialog.cancel();
		           }
		       });
		
		*/
		dyes = new AlertDialogButton();
		dyes.addEventListener(Event.CLICK, this);
		builder.setPositiveButton("Yes",dyes);
	}
	public void show(){
		android.app.AlertDialog alert = builder.create();
		alert.show();
	}
	public void event(Event e){
		if(e.target == dyes){
			
		}else{
			
			
		}
	} 
}
